import com.shenlan.project.*
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.FileSystem
import org.apache.hadoop.fs.Path
import org.junit.Test
import java.io.File
import java.net.URI

class UploadTest {
    @Test
    fun testHdfsFileUpload() {
        // val model = HdfsFileUploadModel().apply {
        //     dataSourceType = "ais"
        //     rawDataPath = "C:\\Users\\admin\\Downloads\\2019"
        // }
        //
        // val fileModel = UploadService().hdfsFileUpload(model)
        // objectMapper.writeValueAsString(fileModel).run { println(this) }
    }

    @Test
    fun testSparkFileUpload() {
        // val model = HdfsFileUploadModel().apply {
        //     hdfsPath ="/energy/ais/history/2019"
        //     sparkType = 0
        //     timeType = 0
        // }
        //
        // val returnModel = ReturnModel()
        // UploadService().sparkFileUpload(model, returnModel)
        // objectMapper.writeValueAsString(returnModel).run { println(this) }
    }

    @Test
    fun testChFileUpload() {
        // val model = HdfsFileUploadModel().apply {
        //     outType = "position"
        //     hdfsPath ="/energy/ais/history/2019/201905"
        //     timeType = 0
        // }
        //
        // val chFileUpload = UploadService().chFileUpload(model)
        // objectMapper.writeValueAsString(chFileUpload).run { println(this) }
    }

    @Test
    fun test() {
        println(TimeUtil.mmToFormat(500L))
    }
}
